From 8723f43c22f314c27d20d0a20bb33b31833472d7 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Thu, 26 Mar 2026 19:29:44 +0100 Subject: [PATCH] keyboard: Ensure minimum height of the OSK always fits on screen At very low resolutions, 1/3 of the screen height might not be enough for the minimum height of the OSK, causing some keys to get pushed out of the screen. This now ensures the height is always at least the minimum height, but only up to 1/2 of the screen to avoid situations where the OSK would cover the whole screen preventing any other interaction. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/9126 Part-of: --- js/ui/keyboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 644409e35..e2d12a155 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1623,6 +1623,7 @@ export const Keyboard = GObject.registerClass({ _relayout() { const monitor = Main.layoutManager.keyboardMonitor; + const [minHeight] = this.get_preferred_height(-1); if (!monitor) return; @@ -1633,6 +1634,8 @@ export const Keyboard = GObject.registerClass({ this.height = monitor.height / 3; else this.height = monitor.height / 4; + + this.height = Math.clamp(this.height, minHeight, monitor.height / 2); } _updateKeys() { -- 2.39.5